package cn.bytecollege.user.dao;

import cn.bytecollege.common.dao.BaseDao;
import cn.bytecollege.common.entity.Cuisine;
import cn.bytecollege.common.util.DBHelper;

import java.util.List;

public class CuisineDao extends BaseDao<Cuisine,Integer> {
    private DBHelper helper = null;

    public CuisineDao() {
        helper = new DBHelper();
    }

    /**
     * 查询菜品信息
     * @return
     */
    public List<Cuisine> find(){
        String sql = "SELECT CUISINE_ID,CUISINE_NAME,CUISINE_PRICE,CATEGORY_NAME," +
                "CUISINE_PHOTO FROM CUISINE LEFT JOIN CATEGORY ON CUISINE.CATEGORY_ID" +
                "=CATEGORY.CATEGORY_ID";
        return helper.executeQuery(sql,Cuisine.class);
    }
}
